#!/usr/bin/python

"""
Makes sz4 filenames human-readable

Usage:
ls | ./sz4name2datetime | sort
"""

from datetime import datetime
from os import path
import fileinput

for full_path in fileinput.input():
	full_path = full_path.strip()
	filename = path.basename(full_path)
	if filename.endswith(".sz4"):
		try:
			timestamp = filename.split('.')[0]
			print str(full_path) + " : " + str(datetime.fromtimestamp(int(timestamp)))
		except Exception as ex:
			print ex
